//---------------------------------------------------------------------------


#pragma hdrstop

#include "TControlState.h"

//---------------------------------------------------------------------------

#pragma package(smart_init)


void __fastcall TControlState::AddItem(const int CutNumber, const float Time,
													const bool CtrState,	const int CtrRetarderQuantity)
{
	TControlStateItem Item;
	Item.CutNumber = CutNumber;
	Item.Time = Time;
	Item.State = CtrState;
	Item.CtrRetarderQuantity = CtrRetarderQuantity;
	push_back(Item);
}

vector<float> __fastcall TControlState::GetUnitTimeQuantity(const float UnitTime)
{
	vector<float> Result;
	int i;
	if (EndTime == 0 || UnitTime < 0.001)
		return Result;
	i = EndTime / UnitTime;
	Result.resize(i);
	for (i = 0; i < size(); i++) {
   	Result[i].
		Result[int(at(i).Time / UnitTime)].StateQuantity += at(i).CtrReatrderQuantity;
	}
}
